﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mwc="clr-namespace:Mongoose.Windows.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Mongoose.Windows;component/Themes/Shared.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="PadControlBarDefaultStyle" TargetType="{x:Type mwc:PadControlBar}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    </Style>

    <ControlTemplate x:Key="PadControlBarDefaultTemplate" TargetType="{x:Type mwc:PadControlBar}">
        <Border BorderThickness="0" Background="{TemplateBinding Background}">
            <DockPanel Margin="4">

                <!--Close button-->
                <mwc:PathButton x:Name="PART_CloseButton"
                                Style="{StaticResource CloseButton}"
                                DockPanel.Dock="Right"
                                Background="{TemplateBinding Foreground}"
                                Foreground="{TemplateBinding Foreground}"
                                Margin="0,0,3,0"
                                SnapsToDevicePixels="True"/>

                <mwc:PathToggleButton x:Name="PART_PinToggleButton"
                                      Style="{StaticResource PinToggleButton}"
                                      DockPanel.Dock="Right" 
                                      Background="{TemplateBinding Foreground}"
                                      Foreground="{TemplateBinding Foreground}"
                                      Margin="0,0,3,0"
                                      SnapsToDevicePixels="True"/>

                <Grid Style="{x:Null}" FocusVisualStyle="{x:Null}">
                    <TextBlock Text="{Binding DisplayName, RelativeSource={RelativeSource AncestorType={x:Type mwc:Pad}}}"
                               FontStyle="Normal"
                               FontWeight="Bold"
                               Foreground="{TemplateBinding Foreground}"
                               SnapsToDevicePixels="True"
                               Style="{x:Null}" FocusVisualStyle="{x:Null}"/>

                    <!-- This is a very tricky workaround to avoid "Airspace" issue when the content of a Pad is a win32 control host like WebBrowser
                         Having a control like textBlock that will refresh each time the pad is moved will ensure that the translation is correctly applied to these kind of controls-->
                    <TextBlock Text="{Binding Position, RelativeSource={RelativeSource AncestorType={x:Type mwc:Pad}}}" Width="0" Height="0" Style="{x:Null}" FocusVisualStyle="{x:Null}"/>

                    <Thumb x:Name="PART_Thumb" Margin="-4" Style="{x:Null}" FocusVisualStyle="{x:Null}">
                        <Thumb.Template>
                            <ControlTemplate>
                                <Grid Background="Transparent" Style="{x:Null}" FocusVisualStyle="{x:Null}"/>
                            </ControlTemplate>
                        </Thumb.Template>
                    </Thumb>
                </Grid>
            </DockPanel>
        </Border>
    </ControlTemplate>

</ResourceDictionary>